﻿using AutoMapper;
using Modules;
using Modules.Attachment;
using Modules.Project;
using PmSoft;
using System.ComponentModel.DataAnnotations;

namespace ManagementApi.Models.Project;

/// <summary>
/// 完工销户申请新增编辑表单
/// </summary>
public class ProjectCompletedEditForm
{
    /// <summary>
    /// 主键
    ///</summary>
    [Display(Name = "id")]
    public int Id { get; set; }

    /// <summary>
    /// 项目ID
    ///</summary>
    public int? ProjectId { get; set; }

    /// <summary>
    /// 申请理由
    ///</summary>
    [Display(Name = "申请理由")]
    [Required(ErrorMessage = "{0}不能为空")]
    [MaxLength(50,ErrorMessage ="{0}长度不能超过{1}")]
    public string? ApplyReason { get; set; }

    ///// <summary>
    ///// 实际竣工日期
    /////</summary>
    //[Display(Name = "实际竣工日期")]
    //public DateTime? EndDate { get; set; }

    /// <summary>
    /// 附件集合
    /// </summary>
    [Display(Name = "附件")]
    [Required(ErrorMessage = "{0}不能为空")]
    public Dictionary<附件类型, List<AttachmentsForm<int>>> dicAttachments { get; set; } = new Dictionary<附件类型, List<AttachmentsForm<int>>>();
}

/// <summary>
/// 完工销户申请审核表单
/// </summary>
public class ProjectCompletedAuditForm
{
    /// <summary>
    /// 主键
    ///</summary>
    [Display(Name = "id")]
    public int Id { get; set; }

    /// <summary>
    /// 申请状态
    ///</summary>
    [Display(Name = "申请状态")]
    [Required(ErrorMessage = "{0}不能为空")]
    public ProjectConstants.完工销户申请状态 AuditType { get; set; }

    /// <summary>
    /// 审核/退还原因说明
    ///</summary>
    [Display(Name = "审核/退还原因说明")]
    [Required(ErrorMessage = "{0}不能为空")]
    public string? RefundReason { get; set; }

    /// <summary>
    /// 退还保证金
    ///</summary>
    [Display(Name = "退还保证金")]
    [Required(ErrorMessage = "{0}不能为空")]
    public decimal RefundAmount { get; set; }
}